package com.heima.media.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.common.dto.ResponseResult;
import com.heima.media.service.IWmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: itheima
 * @create: 2022-03-23 12:01
 */
@RestController
public class LoginController {

    @Autowired
    private IWmUserService wmUserService;

    /**
     * 自媒体用户登录
     * @param loginDto 登录信息
     * @return 业务数据：data:{user:{},token:""}
     */
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody LoginDto loginDto){
        return wmUserService.login(loginDto);
    }
}
